package com.billdowney.util.return_type;

import java.util.List;

import org.springframework.data.domain.Page;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;

/**
 * 数据库查询过后所得分页参数和数据
 * 
 * @author 超级小富翁 - BillDowney
 * @date 2019年4月26日 上午9:18:45
 */
@ApiModel(description = "请求返回的分页数据格式")
public class DataPaging {

	@ApiModelProperty(value = "数据列表", notes = "用于前台展示")
	private Object list;
	@ApiModelProperty(value = "当前页数", dataType = "Integer")
	private int pageNum;
	@ApiModelProperty(value = "当前页面条数", notes = "每一页展示的数据数量", dataType = "Integer")
	private int pageSize;
	@ApiModelProperty(value = "总页数", dataType = "Integer")
	private int pageTotal;
	@ApiModelProperty(value = "总条数", dataType = "long")
	private long total;
	@ApiModelProperty(value = "第一页", dataType = "Integer")
	private int firstPage;
	@ApiModelProperty(value = "上一页", dataType = "Integer")
	private int prePage;
	@ApiModelProperty(value = "下一页", dataType = "Integer")
	private int nextPage;
	@ApiModelProperty(value = "最后一页", dataType = "Integer")
	private int lastPage;
	@ApiModelProperty(value = "是否是第一页", dataType = "boolean")
	private boolean ISFirstPage;
	@ApiModelProperty(value = "是否是最后一页", dataType = "boolean")
	private boolean ISLastPage;
	@ApiModelProperty(value = "是否有上一页", dataType = "boolean")
	private boolean hasPreviousPage;
	@ApiModelProperty(value = "是否有下一页", dataType = "boolean")
	private boolean hasNextPage;
	@ApiModelProperty(value = "导航页数", notes = "默认为7", dataType = "Integer")
	private int navigatePages = 7;
	@ApiModelProperty(value = "导航页列表", notes = "计算得出的展示的导航列表", dataType = "List<Integer>")
	private List<Integer> navigatepageNums;

	public DataPaging() {
	}

	public DataPaging(Page<?> page) {
	}

	public int getPageTotal() {
		return pageTotal;
	}

	public void setPageTotal(int pageTotal) {
		this.pageTotal = pageTotal;
	}

	public Object getList() {
		return list;
	}

	public void setList(Object list) {
		this.list = list;
	}

	public int getPageNum() {
		return pageNum;
	}

	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}

	public int getPageSize() {
		return pageSize;
	}

	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public int getFirstPage() {
		return firstPage;
	}

	public void setFirstPage(int firstPage) {
		this.firstPage = firstPage;
	}

	public int getPrePage() {
		return prePage;
	}

	public void setPrePage(int prePage) {
		this.prePage = prePage;
	}

	public int getNextPage() {
		return nextPage;
	}

	public void setNextPage(int nextPage) {
		this.nextPage = nextPage;
	}

	public int getLastPage() {
		return lastPage;
	}

	public void setLastPage(int lastPage) {
		this.lastPage = lastPage;
	}

	public boolean isISFirstPage() {
		return ISFirstPage;
	}

	public void setISFirstPage(boolean iSFirstPage) {
		ISFirstPage = iSFirstPage;
	}

	public boolean isISLastPage() {
		return ISLastPage;
	}

	public void setISLastPage(boolean iSLastPage) {
		ISLastPage = iSLastPage;
	}

	public boolean isHasPreviousPage() {
		return hasPreviousPage;
	}

	public void setHasPreviousPage(boolean hasPreviousPage) {
		this.hasPreviousPage = hasPreviousPage;
	}

	public boolean isHasNextPage() {
		return hasNextPage;
	}

	public void setHasNextPage(boolean hasNextPage) {
		this.hasNextPage = hasNextPage;
	}

	public int getNavigatePages() {
		return navigatePages;
	}

	public void setNavigatePages(int navigatePages) {
		this.navigatePages = navigatePages;
	}

	public List<Integer> getNavigatepageNums() {
		return navigatepageNums;
	}

	public void setNavigatepageNums(List<Integer> navigatepageNums) {
		this.navigatepageNums = navigatepageNums;
	}

	@Override
	public String toString() {
		return "DataPagingFormat [list=" + list + ", pageNum=" + pageNum + ", pageSize=" + pageSize + ", pageTotal="
				+ pageTotal + ", total=" + total + ", firstPage=" + firstPage + ", prePage=" + prePage + ", nextPage="
				+ nextPage + ", lastPage=" + lastPage + ", ISFirstPage=" + ISFirstPage + ", ISLastPage=" + ISLastPage
				+ ", hasPreviousPage=" + hasPreviousPage + ", hasNextPage=" + hasNextPage + ", navigatePages="
				+ navigatePages + ", navigatepageNums=" + navigatepageNums + "]";
	}

}
